#ifndef __PLATFORMMGR_H__
#define __PLATFORMMGR_H__



#include <wild/WildArray.h>
#include <wild/SceneRoleMgr.h>
#include <wild/WildConfig.h>


namespace wild
{



class SceneRoleMgr;


class Platform
{
	
public:
	Platform();		
	virtual ~Platform(){};

	bool Initialize();
	void Finialize();
	
	void Start();
	void Stop();
	void UpdateFrame();
	void Reset();

	//int CreateSceneRoleMgr(char* pcName);
	bool RemoveSceneRoleMgr(int iID);
	SceneRoleMgr* GetRoleMgr(int iID);

	template<class F>
	int CreateSceneRoleMgr(const char* pcName,F* factory)
	{
		if(!pcName||strlen(pcName)==0)
			return IWA_NULL;

		SceneRoleMgr* poMgr_ = factory->GeneralObject(pcName);
		poMgr_->Start();

		return _oSceneList.Add(poMgr_,pcName);
	}	

	DEC_INLINE_1(FullScreen, bool, _bFullScreen);






	bool SetNowUseScene(int iID);

protected:
	virtual bool OnConfigure(void) = 0;
	virtual void OnStart() = 0;
	virtual void OnStop() = 0;
	virtual void OnUpdate() = 0;

	typedef WildArray<SceneRoleMgr> SCENE_LIST;

	SCENE_LIST _oSceneList;
	bool _bFullScreen;


};






}	//	namespace wild

#endif	//	__PLATFORMMGR_H__
